<!DOCTYPE html>
<html lang="ru">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Вход</title>
	<link rel="stylesheet" href="../css/style.css">
	<link rel="shortcut icon" href="https://bsquare.co.in/assets/php_icon.png">
</head>
<body>
	<div class="content-wraper">
		<div class="content">
			<?php 
				if ($_POST){
					$user_email = $_POST['user_email'];
					$user_password = md5($_POST['user_password']);
					$connect = mysqli_connect('localhost', 'root', 'root', 'pr8.4');
					$login = mysqli_query($connect, "SELECT * FROM `users` WHERE `login` = '$user_email' AND `password` = '$user_password'");
					if ($login){
						$user_name = mysqli_fetch_assoc($login)['full_name'];
						echo "Здравствуйте ". $user_name;;
					}else{
					echo "Данные введены неверно!";
					}
				}
				 

				if ($_GET){
					$g = $_GET;
					if ($g['a'] == 'a.a'){
						$connt++;
					}
					if ($g['b'] == 'b.b'){
						$connt++;
					}
					if ($g['c'] == 'c.c'){
						$connt++;
					}
					if ($g['d'] == 'd.d'){
						$connt++;
					}
					if ($g['e'] == 'ответ'){
						$connt++;
					}
					$resl = $connt / 5 * 100;
					echo "<br>Результат: $resl %";
				}
			?>
		</div>
	</div>
</body>
</html>